require('./PageUserLogin.less');

import React, {Component} from 'react';
import Reflux from 'reflux';
import ReactMixin from 'react-mixin';
import Actions from './Actions'
import Store from './Store';
import 'weui';
import {
  Tab, TabBarItem, TabBar, Page,
  Panel,
  PanelHeader,
  PanelBody,
  PanelFooter,
  MediaBox,
  MediaBoxHeader,
  MediaBoxBody,
  MediaBoxTitle,
  MediaBoxDescription,
  MediaBoxInfo,
  MediaBoxInfoMeta,
  Cells,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Flex,
  FlexItem,
  Grids
} from 'react-weui/build/packages'

import rypic from '../../../assets/icon/人员新增.png';
import {Control, HashRouter, Route} from 'react-keeper'
import Utils from '../../../utils/index'

const appMsgIcon = <img
  src=""/>


class UserLogin extends Component {
  constructor(props) {
    super(props);

    this.myinfoHome = this.myinfoHome.bind(this);
  }

  myinfoHome() {
    Control.go('/myinfo');
  }

  render() {
    return (
      <div className="page userlogin">
        <Panel className="head-panel">
          <PanelHeader>
            <div className="title-bg"/>
            个人信息
          </PanelHeader>
          <PanelBody access link onClick={this.myinfoHome}>
            <MediaBox type="appmsg">
              <MediaBoxHeader>
                {appMsgIcon}
              </MediaBoxHeader>
              <MediaBoxBody>
                <MediaBoxTitle>
                  <p style={{paddingTop: '10px'}}>{this.state.userlogin.userInfo.name}[{this.state.userlogin.userInfo.telNum}]</p>
                </MediaBoxTitle>
                <MediaBoxDescription>

                  <p style={{paddingTop: '5px'}}>{this.state.userlogin.userInfo.organName}</p>
                </MediaBoxDescription>
                <MediaBoxInfo>
                  <MediaBoxInfoMeta>参与工程</MediaBoxInfoMeta>
                  <MediaBoxInfoMeta extra>审核通过</MediaBoxInfoMeta>
                  <MediaBoxInfoMeta extra>证书</MediaBoxInfoMeta>
                </MediaBoxInfo>
              </MediaBoxBody>
            </MediaBox>
          </PanelBody>
        </Panel>
      </div>
    )
  }


  componentWillMount() {
    Actions.initMode();
  }

  componentDidMount() {
    Actions.initUser();

  }


  componentWillReceiveProps(nextProps) {

  }

  shouldComponentUpdate(nextProps, nextState) {

    return true;
  }

  componentWillUpdate(nextProps, nextState) {

  }


  componentDidUpdate(prevProps, prevState) {

  }


  componentWillUnmount() {

  }
}

ReactMixin.onClass(UserLogin, Reflux.connect(Store, 'userlogin'));

export default UserLogin;
